﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HR_Interfaces;
using DataObject;
using DataContext;
using Entity;

namespace HR_Implements
{
    public class EmployeeRemoteObject:MarshalByRefObject,IEmployee
    {
        DB_HRDataContext ctx = new DB_HRDataContext();
        public List<EmployeeEntity> getAllEmployees()
        {
            var q = from e in ctx.Employees
                    select new EmployeeEntity()
                    {
                        EmID=e.cEmployeeCode,
                        Qualifi=e.vQualification
                    };
            return q.ToList();
        }

        public List<EmployeeEntity> searchByQualification(String qua)
        {
            var q = from e in ctx.Employees
                    where e.vQualification.Contains(qua)
                    select new EmployeeEntity()
                    {
                        EmID = e.cEmployeeCode,
                        Qualifi = e.vQualification
                    };
            return q.ToList();
        }
    }
}
